Optimal. Leaf size=80 \[ -\frac {\sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}-\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {\sec (c+d x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3104, 3770, 3074, 206} \[ -\frac {\sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}-\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {\sec (c+d x)}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 3074
Rule 3104
Rule 3770
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx &=\frac {\sec (c+d x)}{b d}-\frac {a \int \sec (c+d x) \, dx}{b^2}+\frac {\left (a^2+b^2\right ) \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{b^2}\\ &=-\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {\sec (c+d x)}{b d}-\frac {\left (a^2+b^2\right ) \operatorname {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,b \cos (c+d x)-a \sin (c+d x)\right )}{b^2 d}\\ &=-\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}-\frac {\sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.14, size = 109, normalized size = 1.36 \[ \frac {2 \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )-b}{\sqrt {a^2+b^2}}\right )+a \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )+b \sec (c+d x)}{b^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.72, size = 191, normalized size = 2.39 \[ -\frac {a \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - \sqrt {a^{2} + b^{2}} \cos \left (d x + c\right ) \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 2 \, b}{2 \, b^{2} d \cos \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.32, size = 136, normalized size = 1.70 \[ -\frac {\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{2}} - \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{b^{2}} + \frac {2}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} b}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.23, size = 174, normalized size = 2.18 \[ -\frac {1}{d b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d \,b^{2}}+\frac {1}{d b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d \,b^{2}}+\frac {2 \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right ) a^{2}}{d \,b^{2} \sqrt {a^{2}+b^{2}}}+\frac {2 \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{d \sqrt {a^{2}+b^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.69, size = 163, normalized size = 2.04 \[ -\frac {\frac {a \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{2}} - \frac {a \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{b^{2}} - \frac {2}{b - \frac {b \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.71, size = 310, normalized size = 3.88 \[ \frac {2\,\mathrm {atanh}\left (\frac {64\,a^2\,\sqrt {a^2+b^2}}{64\,a^2\,b+\frac {64\,a^4}{b}+128\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+128\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {128\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{64\,a^2+\frac {64\,a^4}{b^2}+\frac {128\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}+128\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{64\,a^4+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b+64\,a^2\,b^2+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^3}\right )\,\sqrt {a^2+b^2}}{b^2\,d}-\frac {2\,a\,\mathrm {atanh}\left (\frac {64\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^2+\frac {64\,a^4}{b^2}}+\frac {64\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^4+64\,a^2\,b^2}\right )}{b^2\,d}-\frac {2}{b\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{2}{\left (c + d x \right )}}{a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________